package site.member.dao;

import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import site.member.domain.MemberCommand;
import site.member.domain.MemberPassDto;

@Component
public class MemberDaoImpl extends SqlSessionDaoSupport implements MemberDao {

	@Override
	public void Useradd(MemberCommand userData) {
		getSqlSession().insert("UserInsert", userData);
	}

	@Override
	public int JoinCheckId(Map<String, Object> map) {
		return getSqlSession().selectOne("JoinCheckIdCount",map);
	}

	@Override
	public MemberCommand getUserData(String id) {
		MemberCommand memberCommand = getSqlSession().selectOne("getUserDate",id);
		return memberCommand;
	}

	@Override
	public int UserDateUpdate(MemberCommand command) {
		return getSqlSession().update("updateUserInfo",command);
	}

	@Override
	public int UserPassUpdate(MemberPassDto command) {
		return getSqlSession().update("updateUserPass",command);
	}
}
